<?php if( !empty ($this->arrHotVideo) || !empty ($this->arrHotPhoto)){ ?>
<div id="box_video_hot"  class=" box_col_670 box_width_common left">
    <div class="main_content_box">
        <div class="tab_video title_tab">
            <ul>
                <li class="active"><a href="javascript:;" rel="tab1">Video Clip mới</a></li>
                <li><a href="javascript:;" rel="tab2">Ảnh Mới</a></li>
            </ul>
        </div>
        <div class="main_content_slide_2tab">
            <div class="content_tab tab1" style="display:block; position: absolute; left: -10000px;" id="box_slide_video">
                <div class="content_box_video">
                    <div id="slides_video">
                        <div class="slides_container">
                            <?php if( !empty ($this->arrHotVideo) ){ 
                                    foreach ($this->arrHotVideo as $objvideo){
                                    ?>
                                <ul>
                                    <?php foreach ($objvideo as $video){?>
                                    <li>
                                        <div class="block_image_thumb">
                                            <a href="<?php echo $this->articleurl($video); ?>" title="<?php echo $video["title"];?>" alt="<?php echo $video["title"];?>"><img src="<?php echo $this->Imageurlvideo($video['thumbnail_url'], $this->imageSize['size3']);?>" title="<?php echo $video["title"];?>" alt="<?php echo $video["title"];?>" width="155" height="116" />
                                                <span class="icon_play">&nbsp;</span> </a>
                                        </div>

                                        <h2>
                                            <a href="<?php echo $this->articleurl($video); ?>" class="" title="<?php echo $video["title"];?>" alt="<?php echo $video["title"];?>"><?php echo $video["title"];?> </a>
                                        </h2>
                                        <p class="txt_gray txt_11">Lượt xem: <?php echo $this->Articleview($video); ?></p>
                                    </li>
                                    <?php } ?>
                                </ul>
                                <?php } } ?>
                        </div>
                    </div>
                </div>
            </div>
            <div class="content_tab tab2" style="position: absolute; left: -10000px;">
                <div class="content_box_video">
                    <div id="slides_photo">
                        <div class="slides_container">
                            <?php if( !empty ($this->arrHotPhoto) ){
                                    foreach ($this->arrHotPhoto as $objphoto){
                                    ?>
                                    <ul>
                                        <?php foreach ($objphoto as $photo){?>
                                        <li>
                                            <div class="block_image_thumb">
                                                <a href="<?php echo $this->Articleurl($photo);?>" title="<?php echo $photo["title"];?>" alt="<?php echo $photo["title"];?>"><img src="<?php echo $this->imageurl($photo['thumbnail_url'], $this->imageSize['size3']);?>" width="155" height="116" title="<?php echo $photo["title"];?>" alt="<?php echo $photo["title"];?>" />
                                                    <span class="icon_photo">&nbsp;</span> </a>
                                            </div>

                                            <h2>
                                                <a href="<?php echo $this->Articleurl($photo);?>" title="<?php echo $photo["title"];?>" alt="<?php echo $photo["title"];?>"><?php echo $photo["title"];?> </a>
                                            </h2>
                                            <p class="txt_gray txt_11">Lượt xem: <?php echo $this->Articleview($photo); ?></p>
                                        </li>
                                        <?php } ?>
                                    </ul>
                                <?php } } ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php } ?>
<link href="<?php echo $this->config['css']; ?>/slide.css" media="screen" rel="stylesheet" type="text/css" />
<!-- InstanceBeginEditable name="Javascript" -->
<script type="text/javascript" src="<?php echo $this->config['js']; ?>/lib/lib.js"></script>
<script type="text/javascript" src="<?php echo $this->config['js']; ?>/jquery.ad-gallery.js"></script>
<script type="text/javascript">
    /*
     *Pop up slide photo
     */
    $(document).ready(function() {
        $('.show_popup').live('click', function showPopup(){
            $('.main_ct_popup').fadeIn(0);
            var ctheight = $(window).height();
            var ctwidth = $(window).width();
            var ctpopupwidth = $('#gallery').width();
            var ctpopupheight = $('#gallery').height();
            
            /* Get albumId */
            var albumId = $(this).attr('aid');
            var albumName = $(this).attr('albumName');
            var url_loading = IMAGES_URL+'/loading.gif';
            /* Get album detail */
            
            $.ajax({
                type:'GET',
                url: '<?php echo BASE_URL?>/block/getlistphoto',
                data:({
                    albumId:albumId,
                    albumName:albumName
                }),
                dataType:'html',
                beforeSend: function(){
                    $('#thumb-list').hide();
                    $('#ad-image div.ad-image').hide();
                    $('div.not-found').remove();
                    $('#ad-image').append('<img class="ad-loader" src="'+url_loading+'" style="border: medium none; display: block;">');
                },
                success:function(response){
                    if(response != ''){
                        $('#thumb-list').html(response).fadeIn('fast', function(){
                            var galleries = $('#gallery').adGallery();

                            $('#switch-effect').change(function() {
                                galleries[0].settings.effect = $(this).val();
                                return false;
                            });

                            $('#toggle-slideshow').click(function() {
                                galleries[0].slideshow.toggle();
                                return false;
                            });

                            $('#toggle-description').click(function() {
                                if(!galleries[0].settings.description_wrapper) {
                                    galleries[0].settings.description_wrapper = $('#descriptions');
                                } else {
                                    galleries[0].settings.description_wrapper = false;
                                }
                                return false;
                            });
                        });
                    
                    }
                    else
                    {
                        $('img.ad-loader').remove();
                        $('#ad-image').append('<div class="not-found" style="border: medium none; width:100%; text-align:center; padding-top:250px; display: block;">Không có hình ảnh nào trong album</div>');
                    }
                },
                error:function()
                {
                    $('img.ad-loader').remove();
                    $('#ad-image').append('<div class="not-found" style="border: medium none; width:100%; text-align:center; padding-top:250px; display: block;">Có lỗi xảy ra</div>');
                }
            });
            
            $('.content_pupop').css("left",(ctwidth- ctpopupwidth)/2);
            $('body').css('overflow' , 'hidden');

            $('.btn_close_popup a').click(function(){
                $('.main_ct_popup').fadeOut(0);
                $('body').css('overflow' , 'auto');
            });
        });
    });
</script>